/*
 * CONTROLLER.h
 *
 * Created: 2014-01-02 12:06:53
 *  Author: Marcin
 */ 


#ifndef CONTROLLER_H_
#define CONTROLLER_H_

struct CONTROLLER_CONFIG_TYPE
{
	uint16_t Kp;
	uint16_t Ki;
	uint16_t Kd;
	uint16_t AWU_max;
	uint16_t AWU_min;
	uint8_t SRC_ID;
	uint8_t DEST_ID;	
};

class PID_CONTROLLER
{
	private:
		constexpr uint16_t *m_pPV;
		constexpr uint16_t *m_pSP;
		constexpr uint16_t *m_pMV;
		constexpr CONTROLLER_CONFIG_TYPE *m_pCONFIG;
		uint16_t m_Se;
		uint16_t m_PV_old;
	public:
		PID_CONTROLLER();
		~PID_CONTROLLER();
		void CALCULATE();
		void LOAD_CONFIG();
		void SAVE_CONFIG();	
};

/*class TWO_STATE_CONTROLLER
{
	public:
		TWO_STATE_CONTROLLER();
		~TWO_STATE_CONTROLLER();	
};

class THREE_STATE_CONTROLLER
{
	public:
		THREE_STATE_CONTROLLER();
		~THREE_STATE_CONTROLLER();	
}; */

#endif /* CONTROLLER_H_ */